3.3.25 \(\int \frac {(h+i x) (a+b \log (c (d+e x)^n))^2}{f+g x} \, dx\) [225]

Optimal. Leaf size=215 \[ -\frac {2 a b i n x}{g}+\frac {2 b^2 i n^2 x}{g}-\frac {2 b^2 i n (d+e x) \log \left (c (d+e x)^n\right )}{e g}+\frac {i (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e g}+\frac {(g h-f i) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^2}+\frac {2 b (g h-f i) n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {g (d+e x)}{e f-d g}\right )}{g^2}-\frac {2 b^2 (g h-f i) n^2 \text {Li}_3\left (-\frac {g (d+e x)}{e f-d g}\right )}{g^2} \]

[Out]

-2*a*b*i*n*x/g+2*b^2*i*n^2*x/g-2*b^2*i*n*(e*x+d)*ln(c*(e*x+d)^n)/e/g+i*(e*x+d)*(a+b*ln(c*(e*x+d)^n))^2/e/g+(-f
*i+g*h)*(a+b*ln(c*(e*x+d)^n))^2*ln(e*(g*x+f)/(-d*g+e*f))/g^2+2*b*(-f*i+g*h)*n*(a+b*ln(c*(e*x+d)^n))*polylog(2,
-g*(e*x+d)/(-d*g+e*f))/g^2-2*b^2*(-f*i+g*h)*n^2*polylog(3,-g*(e*x+d)/(-d*g+e*f))/g^2

________________________________________________________________________________________

Rubi [A]
time = 0.19, antiderivative size = 215, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.276, Rules used = {2465, 2436, 2333, 2332, 2443, 2481, 2421, 6724} \begin {gather*} \frac {2 b n (g h-f i) \text {PolyLog}\left (2,-\frac {g (d+e x)}{e f-d g}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )}{g^2}-\frac {2 b^2 n^2 (g h-f i) \text {PolyLog}\left (3,-\frac {g (d+e x)}{e f-d g}\right )}{g^2}+\frac {(g h-f i) \log \left (\frac {e (f+g x)}{e f-d g}\right ) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{g^2}+\frac {i (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e g}-\frac {2 a b i n x}{g}-\frac {2 b^2 i n (d+e x) \log \left (c (d+e x)^n\right )}{e g}+\frac {2 b^2 i n^2 x}{g} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[((h + i*x)*(a + b*Log[c*(d + e*x)^n])^2)/(f + g*x),x]

[Out]

(-2*a*b*i*n*x)/g + (2*b^2*i*n^2*x)/g - (2*b^2*i*n*(d + e*x)*Log[c*(d + e*x)^n])/(e*g) + (i*(d + e*x)*(a + b*Lo
g[c*(d + e*x)^n])^2)/(e*g) + ((g*h - f*i)*(a + b*Log[c*(d + e*x)^n])^2*Log[(e*(f + g*x))/(e*f - d*g)])/g^2 + (
2*b*(g*h - f*i)*n*(a + b*Log[c*(d + e*x)^n])*PolyLog[2, -((g*(d + e*x))/(e*f - d*g))])/g^2 - (2*b^2*(g*h - f*i
)*n^2*PolyLog[3, -((g*(d + e*x))/(e*f - d*g))])/g^2

Rule 2332

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rule 2421

Int[(Log[(d_.)*((e_) + (f_.)*(x_)^(m_.))]*((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.))/(x_), x_Symbol] :> Simp
[(-PolyLog[2, (-d)*f*x^m])*((a + b*Log[c*x^n])^p/m), x] + Dist[b*n*(p/m), Int[PolyLog[2, (-d)*f*x^m]*((a + b*L
og[c*x^n])^(p - 1)/x), x], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IGtQ[p, 0] && EqQ[d*e, 1]

Rule 2436

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rule 2443

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_)/((f_.) + (g_.)*(x_)), x_Symbol] :> Simp[Log[e*((
f + g*x)/(e*f - d*g))]*((a + b*Log[c*(d + e*x)^n])^p/g), x] - Dist[b*e*n*(p/g), Int[Log[(e*(f + g*x))/(e*f - d
*g)]*((a + b*Log[c*(d + e*x)^n])^(p - 1)/(d + e*x)), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, p}, x] && NeQ[e*
f - d*g, 0] && IGtQ[p, 1]

Rule 2465

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[
(a + b*Log[c*(d + e*x)^n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d, e, n}, x] && RationalFunct
ionQ[RFx, x] && IntegerQ[p]

Rule 2481

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + Log[(h_.)*((i_.) + (j_.)*(x_))^(m_.)]*
(g_.))*((k_.) + (l_.)*(x_))^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[(k*(x/d))^r*(a + b*Log[c*x^n])^p*(f + g*Lo
g[h*((e*i - d*j)/e + j*(x/e))^m]), x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, j, k, l, n, p, r},
 x] && EqQ[e*k - d*l, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps

\begin {align*} \int \frac {(h+225 x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x} \, dx &=\int \left (\frac {225 \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{g}+\frac {(-225 f+g h) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{g (f+g x)}\right ) \, dx\\ &=\frac {225 \int \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \, dx}{g}+\frac {(-225 f+g h) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right )^2}{f+g x} \, dx}{g}\\ &=-\frac {(225 f-g h) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^2}+\frac {225 \text {Subst}\left (\int \left (a+b \log \left (c x^n\right )\right )^2 \, dx,x,d+e x\right )}{e g}+\frac {(2 b e (225 f-g h) n) \int \frac {\left (a+b \log \left (c (d+e x)^n\right )\right ) \log \left (\frac {e (f+g x)}{e f-d g}\right )}{d+e x} \, dx}{g^2}\\ &=\frac {225 (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e g}-\frac {(225 f-g h) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^2}-\frac {(450 b n) \text {Subst}\left (\int \left (a+b \log \left (c x^n\right )\right ) \, dx,x,d+e x\right )}{e g}+\frac {(2 b (225 f-g h) n) \text {Subst}\left (\int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (\frac {e \left (\frac {e f-d g}{e}+\frac {g x}{e}\right )}{e f-d g}\right )}{x} \, dx,x,d+e x\right )}{g^2}\\ &=-\frac {450 a b n x}{g}+\frac {225 (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e g}-\frac {(225 f-g h) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^2}-\frac {2 b (225 f-g h) n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {g (d+e x)}{e f-d g}\right )}{g^2}-\frac {\left (450 b^2 n\right ) \text {Subst}\left (\int \log \left (c x^n\right ) \, dx,x,d+e x\right )}{e g}+\frac {\left (2 b^2 (225 f-g h) n^2\right ) \text {Subst}\left (\int \frac {\text {Li}_2\left (-\frac {g x}{e f-d g}\right )}{x} \, dx,x,d+e x\right )}{g^2}\\ &=-\frac {450 a b n x}{g}+\frac {450 b^2 n^2 x}{g}-\frac {450 b^2 n (d+e x) \log \left (c (d+e x)^n\right )}{e g}+\frac {225 (d+e x) \left (a+b \log \left (c (d+e x)^n\right )\right )^2}{e g}-\frac {(225 f-g h) \left (a+b \log \left (c (d+e x)^n\right )\right )^2 \log \left (\frac {e (f+g x)}{e f-d g}\right )}{g^2}-\frac {2 b (225 f-g h) n \left (a+b \log \left (c (d+e x)^n\right )\right ) \text {Li}_2\left (-\frac {g (d+e x)}{e f-d g}\right )}{g^2}+\frac {2 b^2 (225 f-g h) n^2 \text {Li}_3\left (-\frac {g (d+e x)}{e f-d g}\right )}{g^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(460\) vs. \(2(215)=430\).
time = 0.19, size = 460, normalized size = 2.14 \begin {gather*} \frac {e g i x \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2+e (g h-f i) \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right )^2 \log (f+g x)+2 b e g h n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left (\log (d+e x) \log \left (\frac {e (f+g x)}{e f-d g}\right )+\text {Li}_2\left (\frac {g (d+e x)}{-e f+d g}\right )\right )-2 b i n \left (a-b n \log (d+e x)+b \log \left (c (d+e x)^n\right )\right ) \left (-g (d+e x) (-1+\log (d+e x))+e f \left (\log (d+e x) \log \left (\frac {e (f+g x)}{e f-d g}\right )+\text {Li}_2\left (\frac {g (d+e x)}{-e f+d g}\right )\right )\right )+b^2 i n^2 \left (g \left (2 e x-2 (d+e x) \log (d+e x)+(d+e x) \log ^2(d+e x)\right )-e f \left (\log ^2(d+e x) \log \left (\frac {e (f+g x)}{e f-d g}\right )+2 \log (d+e x) \text {Li}_2\left (\frac {g (d+e x)}{-e f+d g}\right )-2 \text {Li}_3\left (\frac {g (d+e x)}{-e f+d g}\right )\right )\right )+b^2 e g h n^2 \left (\log ^2(d+e x) \log \left (\frac {e (f+g x)}{e f-d g}\right )+2 \log (d+e x) \text {Li}_2\left (\frac {g (d+e x)}{-e f+d g}\right )-2 \text {Li}_3\left (\frac {g (d+e x)}{-e f+d g}\right )\right )}{e g^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[((h + i*x)*(a + b*Log[c*(d + e*x)^n])^2)/(f + g*x),x]

[Out]

(e*g*i*x*(a - b*n*Log[d + e*x] + b*Log[c*(d + e*x)^n])^2 + e*(g*h - f*i)*(a - b*n*Log[d + e*x] + b*Log[c*(d +
e*x)^n])^2*Log[f + g*x] + 2*b*e*g*h*n*(a - b*n*Log[d + e*x] + b*Log[c*(d + e*x)^n])*(Log[d + e*x]*Log[(e*(f +
g*x))/(e*f - d*g)] + PolyLog[2, (g*(d + e*x))/(-(e*f) + d*g)]) - 2*b*i*n*(a - b*n*Log[d + e*x] + b*Log[c*(d +
e*x)^n])*(-(g*(d + e*x)*(-1 + Log[d + e*x])) + e*f*(Log[d + e*x]*Log[(e*(f + g*x))/(e*f - d*g)] + PolyLog[2, (
g*(d + e*x))/(-(e*f) + d*g)])) + b^2*i*n^2*(g*(2*e*x - 2*(d + e*x)*Log[d + e*x] + (d + e*x)*Log[d + e*x]^2) -
e*f*(Log[d + e*x]^2*Log[(e*(f + g*x))/(e*f - d*g)] + 2*Log[d + e*x]*PolyLog[2, (g*(d + e*x))/(-(e*f) + d*g)] -
 2*PolyLog[3, (g*(d + e*x))/(-(e*f) + d*g)])) + b^2*e*g*h*n^2*(Log[d + e*x]^2*Log[(e*(f + g*x))/(e*f - d*g)] +
 2*Log[d + e*x]*PolyLog[2, (g*(d + e*x))/(-(e*f) + d*g)] - 2*PolyLog[3, (g*(d + e*x))/(-(e*f) + d*g)]))/(e*g^2
)

________________________________________________________________________________________

Maple [F]
time = 0.15, size = 0, normalized size = 0.00 \[\int \frac {\left (i x +h \right ) \left (a +b \ln \left (c \left (e x +d \right )^{n}\right )\right )^{2}}{g x +f}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((i*x+h)*(a+b*ln(c*(e*x+d)^n))^2/(g*x+f),x)

[Out]

int((i*x+h)*(a+b*ln(c*(e*x+d)^n))^2/(g*x+f),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)*(a+b*log(c*(e*x+d)^n))^2/(g*x+f),x, algorithm="maxima")

[Out]

I*a^2*(x/g - f*log(g*x + f)/g^2) + a^2*h*log(g*x + f)/g + integrate((b^2*h*log(c)^2 + 2*a*b*h*log(c) + (b^2*h
+ I*b^2*x)*log((x*e + d)^n)^2 + (I*b^2*log(c)^2 + 2*I*a*b*log(c))*x + 2*(b^2*h*log(c) + a*b*h - (-I*b^2*log(c)
 - I*a*b)*x)*log((x*e + d)^n))/(g*x + f), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)*(a+b*log(c*(e*x+d)^n))^2/(g*x+f),x, algorithm="fricas")

[Out]

integral((a^2*h + I*a^2*x + (b^2*h*n^2 + I*b^2*n^2*x)*log(x*e + d)^2 + (b^2*h + I*b^2*x)*log(c)^2 + 2*(a*b*h*n
 + I*a*b*n*x + (b^2*h*n + I*b^2*n*x)*log(c))*log(x*e + d) + 2*(a*b*h + I*a*b*x)*log(c))/(g*x + f), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \log {\left (c \left (d + e x\right )^{n} \right )}\right )^{2} \left (h + i x\right )}{f + g x}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)*(a+b*ln(c*(e*x+d)**n))**2/(g*x+f),x)

[Out]

Integral((a + b*log(c*(d + e*x)**n))**2*(h + i*x)/(f + g*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((i*x+h)*(a+b*log(c*(e*x+d)^n))^2/(g*x+f),x, algorithm="giac")

[Out]

integrate((b*log((x*e + d)^n*c) + a)^2*(h + I*x)/(g*x + f), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {\left (h+i\,x\right )\,{\left (a+b\,\ln \left (c\,{\left (d+e\,x\right )}^n\right )\right )}^2}{f+g\,x} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(((h + i*x)*(a + b*log(c*(d + e*x)^n))^2)/(f + g*x),x)

[Out]

int(((h + i*x)*(a + b*log(c*(d + e*x)^n))^2)/(f + g*x), x)

________________________________________________________________________________________